<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basproject/basicdata/Bas_RouteName.jsx此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :details="details" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/basproject/basicdata/Bas_RouteName.jsx";
import { ref, defineComponent } from "vue";
export default defineComponent({
    name: "Bas_RouteName",
    setup() {
        const table = ref({
            key: "RouteNameId",
            footer: "Foots",
            cnName: "产品工艺",
            name: "basicdata/Bas_RouteName",
            newTabEdit: false,
            url: "/Bas_RouteName/",
            sortName: "RouteNameId"
        });
        const editFormFields = ref({ "RouteCode": "", "RouteName": "", "Version": "", "UseFlag": "", "Remarks": "" });
        const editFormOptions = ref([[{ "title": "工艺编码", "field": "RouteCode" ,'required': true, },
            { "title": "工艺名称", "field": "RouteName", 'required': true, }],
        [{ "title": "版本", "field": "Version",'required': true, type: "number" },
        { "dataKey": "enabled", "data": [], "title": "是否使用", "field": "UseFlag", "type": "switch" }],
        [{ "title": "备注", "field": "Remarks", "colSize": 12, "type": "textarea" }]]);
        const searchFormFields = ref({});
        const searchFormOptions = ref([]);
        const columns = ref([{ field: "RouteCode", title: "工艺编码", type: "string", link: true, width: 120, showOverflowTooltip: true, align: "left" },
        { field: "RouteName", title: "工艺名称", type: "string", width: 120, showOverflowTooltip: true, align: "left" },
        { field: "RouteDesc", title: "工艺描述", type: "string", width: 150, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "FirstGroup", title: "投入工站", type: "bigint", bind: { key: "BASE_Group", data: [] }, width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "EndGroup", title: "产出站", type: "bigint", bind: { key: "BASE_Group", data: [] }, width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "ParentId", title: "ParentId", type: "bigint", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "Type", title: "1是目录，2是文件", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "Enabled", title: "1不禁用，2禁用", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "Version", title: "版本", type: "string", width: 150, showOverflowTooltip: true, align: "left" },
        { field: "Info", title: "画布信息", type: "string", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "ControlType", title: "1通用流程,2按适用机种,3按适用型号", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "Sequence", title: "排序", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "RouteNameId", title: "ID", type: "bigint", width: 110, hidden: true, readonly: true, require: true, showOverflowTooltip: true, align: "left" },
        { field: "IsValid", title: "是否有效", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "CreateId", title: "创建用户", type: "bigint", width: 80, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "Creator", title: "创建人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
        { field: "CreateTime", title: "创建时间", type: "datetime", width: 110, showOverflowTooltip: true, align: "left" },
        { field: "ModifyId", title: "修改用户", type: "bigint", width: 80, hidden: true, showOverflowTooltip: true, align: "left" },
        { field: "Modifier", title: "修改人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
        { field: "ModifyTime", title: "修改时间", type: "datetime", width: 110, showOverflowTooltip: true, align: "left" },
        { field: "Remarks", title: "备注", type: "string", width: 150, showOverflowTooltip: true, align: "left" },
        { field: "UseFlag", title: "是否使用", type: "int", bind: { key: "enabled", data: [] }, width: 120, showOverflowTooltip: true, align: "left" }]);
        const detail = ref({ columns: [] });
        const details = ref([
        //     {
        //     cnName: "工艺步骤",
        //     table: "Bas_RouteControl",
        //     columns: [{ field: "StepSequence", title: "工站顺序", type: "int", link: true, width: 110, edit: { type: "" }, showOverflowTooltip: true, align: "left" },
        //     { field: "RouteNameId", title: "当前工艺", type: "bigint", bind: { key: "BASE_Route", data: [] }, width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        //     { field: "RouteControlId", title: "主键ID", type: "bigint", width: 110, hidden: true, readonly: true, require: true, showOverflowTooltip: true, align: "left" },
        //     { field: "CurrentGroupId", title: "工站", type: "bigint", bind: { key: "BASE_Group", data: [] }, width: 110, edit: { type: "select" }, showOverflowTooltip: true, align: "left" },
        //     { field: "NextGroupId", title: "下一工站", type: "bigint", bind: { key: "BASE_Group", data: [] }, width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        //     { field: "ProductStuffix", title: "产品后缀--毛坯,压坯等", type: "string", width: 120, edit: { type: "" }, showOverflowTooltip: true, align: "left" },
        //     { field: "IsValid", title: "是否有效", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
        //     { field: "CreateId", title: "创建用户", type: "bigint", width: 80, hidden: true, showOverflowTooltip: true, align: "left" },
        //     { field: "Creator", title: "创建人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
        //     { field: "CreateTime", title: "创建时间", type: "datetime", width: 110, showOverflowTooltip: true, align: "left" },
        //     { field: "ModifyId", title: "修改用户", type: "bigint", width: 80, hidden: true, showOverflowTooltip: true, align: "left" },
        //     { field: "Modifier", title: "修改人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
        //     { field: "ModifyTime", title: "修改时间", type: "datetime", width: 110, showOverflowTooltip: true, align: "left" },
        //     { field: "Remarks", title: "备注", type: "string", width: 150, edit: { type: "textarea" }, showOverflowTooltip: true, align: "left" }],
        //     sortName: "StepSequence",
        //     key: "RouteControlId",
        //     buttons: [],
        //     delKeys: [],
        // },
        {
            cnName: "工艺产品",
            table: "Bas_RouteUsage",
            columns: [{ field: "RouteUsageId", title: "ID", type: "bigint", width: 110, hidden: true, readonly: true, require: true, showOverflowTooltip: true, align: "left" },
            { field: "RouteNameId", title: "流程ID", type: "bigint", width: 110, hidden: true, edit: { type: "" }, showOverflowTooltip: true, align: "left" },
            { field: "Sku", title: "产品", type: "bigint", bind: { key: "WMS_Material", data: [] }, width: 110, edit: { type: "select" }, showOverflowTooltip: true, align: "left" },
            { field: "SkuType", title: "型号", type: "bigint", width: 110, edit: { type: "" }, showOverflowTooltip: true, align: "left" },
            { field: "IsValid", title: "是否有效", type: "int", width: 110, hidden: true, showOverflowTooltip: true, align: "left" },
            { field: "CreateId", title: "创建用户", type: "bigint", width: 80, hidden: true, showOverflowTooltip: true, align: "left" },
            { field: "Creator", title: "创建人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
            { field: "CreateTime", title: "创建时间", type: "datetime", width: 110, showOverflowTooltip: true, align: "left" },
            { field: "ModifyId", title: "修改用户", type: "bigint", width: 80, hidden: true, showOverflowTooltip: true, align: "left" },
            { field: "Modifier", title: "修改人", type: "string", width: 100, showOverflowTooltip: true, align: "left" },
            { field: "ModifyTime", title: "修改时间", type: "datetime", width: 110, showOverflowTooltip: true, align: "left" },
            { field: "Remarks", title: "备注", type: "string", width: 150, edit: { type: "textarea" }, showOverflowTooltip: true, align: "left" }],
            sortName: "RouteUsageId",
            key: "RouteUsageId",
            buttons: [],
            delKeys: [],
            detail: null
        }]);
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
            details
        };
    },
});
</script>
